<!DOCTYPE html>
<html lang="">
<head>
    <meta charset="utf-8">
    <title>Retina Dashboard</title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <meta name="robots" content="" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="/static/css/style.css" media="all" />

    <script src="/static/js/jquery-1.10.1.min.js"></script>
    <script src="/static/js/jquery.wysiwyg.js"></script>
    <script src="/static/js/jquery.checkbox.min.js"></script>

    <script src="/static/js/jquery.tablesorter.min.js"></script>
    <style type="text/css">


    </style>
</head>
<body>
<div class="testing">
    <header class="main">
        <h1><strong>Retina</strong> Dashboard</h1>
    </header>
    <section class="user">

        <div class="buttons">
            <span class="button blue"><a href="/admin/login_out/{{.tel}}">登出</a></span>
        </div>
    </section>
</div>
<nav>          <!--左侧导航部分-->
    <ul>
        <li ><a href="/admin/index/{{.tel}}"><span class="icon">&#128711;</span> 设备监控</a></li>
        <li><a href=/admin/admin_list/{{.tel}}><span class="icon">&#128101;</span> 管理员 </a></li>
        <li>
            <a href="/admin/sys_setting/{{.tel}}"><span class="icon">&#9881;</span>系统设置</a>
        </li>
        <li>
            <a href="/admin/show_remote_list/{{.tel}}"><span class="icon">&#9881;</span>显示遥控数据</a>
        </li>
        <li class="section">
            <a href="/admin/add_remote_data/{{.tel}}"><span class="icon">&#9881;</span>添加遥控数据</a>
        </li>
        <li>
            <a href="/admin/app_list/{{.tel}}"><span class="icon">&#9881;</span>app版本管理</a>
        </li>
    </ul>
</nav>
<!-- 页面具体内容-->
<section class="topcontent">
<section class="widget">
<header>
    <span class="icon">&#128200;</span>
    <hgroup>
        <h1>基本信息</h1>
    </hgroup>
    <aside>
        <button id="submit_btn" type="button">更新</button>
    </aside>
</header>
<section class="widget1">

<div class="user_form_class">
<br>
<div id="ziti1"><center> 用户空调数据</center></div>
<br>
<table border="1">
    <tr>
        <td>
            <center>
                <div class="input_tag">遥控器的名字</div>
            </center>
        </td>
        <td><input type="text" class=text id="RemoteName"></td>
        <td><pre></pre></td>
        <td>
            <center>
                <div class="input_tag">编号</div>
            </center>
        </td>
        <td><input type="text"  class=text id="No">
        </td>
    </tr>
    <tr>
        <td>
            <center>
                <div class="input_tag">版本号</div>
            </center>
        </td>
        <td>
            <input type="text" class=text id="Version">
        </td>
        <td><pre>                                        </pre></td>
        <td>
            <center><div class="input_tag">设备型号</div></center>
        </td>
        <td>
            <input type="text" class=text id="DeviceType">
        </td>
        <td>
            <label id="DeviceTypeLabel" style="display:none;color:red">请输入正确的型号</label>
        </td>
    </tr>
    <tr>
        <td>
            <center><div class="input_tag">载波频率</div></center>
        </td>
        <td>
            <input type="text" class=text id="IRFRQ">
        </td>
        <td>
            <label id="IRFRQLabel" style="display:none;color:red">请输入正确的频率</label>
        </td>
        <td>
            <center><div class="input_tag">采样脉冲宽度</div></center>
        </td>
        <td><input type="text" class=text id="TimeScale"></td>
        <td>
            <label id="TimeScaleLabel" style="display:none;color:red">请输入正确的宽度</label>
        </td>
    </tr>
    <tr>
        <td>
            <center>
                <div class="input_tag">关机码字</div>
            </center>
        </td>
        <td><input type="text" class=text id="PoweroffCode"></td>
    </tr>
    <tr>
        <td><center><div class="input_tag">开机码字</div></center></td>
        <td><input type="text" class=text id="BootCode"></td>
    </tr>
    <tr>
        <td><center><div class="input_tag">特殊码型S</div></center></td>
        <td><input type="text" class=text id="Special_S"></td>
    </tr>
    <tr>
        <td><center><div class="input_tag">特殊码型A</div></center></td>
        <td><input type="text" class=text id="Special_A"></td>
    </tr>
    <tr>
        <td><center><div class="input_tag">特殊码型B</div></center></td>
        <td><input type="text" class=text id="Special_B"></td>
    </tr>
    <tr>
        <td><center><div class="input_tag">特殊码型C</div></center></td>
        <td><input type="text" class=text id="Special_C"></td>
    </tr>
    <tr>
        <td><center><div class="input_tag">特殊码型D</div></center></td>
        <td><input type="text" class=text id="Special_D"></td>
    </tr>
    <tr>
        <td><center><div class="input_tag">特殊码型E</div></center></td>
        <td><input type="text" class=text id="Special_E"></td>
    </tr>
    <tr>
        <td><center><div class="input_tag">One</div></center></td>
        <td><input type="text" class=text id="Special_One"></td>
    </tr>
    <tr>
        <td><center><div class="input_tag">Zero</div></center></td>
        <td><input type="text" class=text id="Special_Zero"></td>
    </tr>
</table>
<!--页面Accode格式内容-->
<div id="ziti2">Accode格式</div>
<br>
<table border="1">
    <tr>
        <td><center><div id="model" style="width:140px;">温度</div></center></td><td width="400px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;开始的位数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码值&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位宽</td>    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp16_btn" type="button" style="height:38px;width:100px;">16度</button>
            </center>
        </td>
        <div class="Temp16">
            <td><p16></p16></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp17_btn" type="button" style="height:38px;width:100px;">17度</button>
            </center>
        </td>
        <div class="Temp17">
            <td><p17></p17></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp18_btn" type="button" style="height:38px;width:100px;">18度</button>
            </center>
        </td>
        <div class="Temp18">
            <td><p18></p18></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp19_btn" type="button" style="height:38px;width:100px;">19度</button>
            </center>
        </td>
        <div class="Temp19">
            <td><p19></p19></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp20_btn" type="button" style="height:38px;width:100px;">20度</button>
            </center>
        </td>
        <div class="Temp20">
            <td><p20></p20></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp21_btn" type="button" style="height:38px;width:100px;">21度</button>
            </center>
        </td>
        <div class="Temp21">
            <td><p21></p21></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp22_btn" type="button" style="height:38px;width:100px;">22度</button>
            </center>
        </td>
        <div class="Temp22">
            <td><p22></p22></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp23_btn" type="button" style="height:38px;width:100px;">23度</button>
            </center>
        </td>
        <div class="Temp23">
            <td><p23></p23></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp24_btn" type="button" style="height:38px;width:100px;">24度</button>
            </center>
        </td>
        <div class="Temp24">
            <td><p24></p24></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp25_btn" type="button" style="height:38px;width:100px;">25度</button>
            </center>
        </td>
        <div class="Temp25">
            <td><p25></p25></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp26_btn" type="button" style="height:38px;width:100px;">26度</button>
            </center>
        </td>
        <div class="Temp26">
            <td><p26></p26></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp27_btn" type="button" style="height:38px;width:100px;">27度</button>
            </center>
        </td>
        <div class="Temp27">
            <td><p27></p27></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp28_btn" type="button" style="height:38px;width:100px;">28度</button>
            </center>
        </td>
        <div class="Temp28">
            <td><p28></p28></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp29_btn" type="button" style="height:38px;width:100px;">29度</button>
            </center>
        </td>
        <div class="Temp29">
            <td><p29></p29></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp30_btn" type="button" style="height:38px;width:100px;">30度</button>
            </center>
        </td>
        <div class="Temp30">
            <td><p30></p30></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp31_btn" type="button" style="height:38px;width:100px;">31度</button>
            </center>
        </td>
        <div class="Temp31">
            <td><p31></p31></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="Temp32_btn" type="button" style="height:38px;width:100px;">32度</button>
            </center>
        </td>
        <div class="Temp32">
            <td><p32></p32></td>
        </div>
    </tr>
    <br>
</table>
<br>
<br>
<table border="1">
    <tr>
        <!--<td><center><div id="model" style="width:140px;">模式</div></center></td><td><center><div class="form_tag" style="width:140px;">开始的位数</div></center></td><td><center><div class="form_tag" style="width:140px;">码值</div></center></td><td><center><div class="form_tag" style="width:140px;">位宽</div></center></td>-->
        <td><center><div id="model" style="width:140px;">模式</div></center></td><td width="400px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;开始的位数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码值&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位宽</td>
    </tr>
    <tr>
        <td>
            <center>
                <button id="WindAutoModel_btn" type="button" style="height:38px;width:140px;">风速自动模式</button>
            </center>
        </td>
        <div class="WindAutoModel">
            <td><p></p></td>
        </div>
    </tr>

    <tr>
        <td>
            <center>
                <!--<div id="WindHighModel_TAG">风速高模式</div>-->
                <button id="WindHighModel_btn" type="button" style="height:38px;width:140px;">风速高模式</button>
            </center>
        </td>
        <div class="WindHighModel">
            <td><p1></p1></td>
        </div>
    </tr>

    <tr>
        <td>
            <center>
                <button id="WindMidModel_btn" type="button" style="height:38px;width:140px;">风速中模式</button>
            </center>
        </td>
        <div class="WindMidModel">
            <td><p2></p2></td>
        </div>
    </tr>

    <tr>
        <td>
            <center>
                <button id="WindLowModel_btn" type="button" style="height:38px;width:140px;">风速低模式</button>
            </center>
        </td>
        <div class="WindLowModel">
            <td><p3></p3></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="HotModel_btn" type="button" style="height:38px;width:140px;">制热模式</button>
            </center>
        </td>
        <div class="HotModel">
            <td><p4></p4></td>
        </div>
    </tr>

    <tr>
        <td>
            <center>
                <button id="CodeModel_btn" type="button" style="height:38px;width:140px;">制冷模式</button>
            </center>
        </td>
        <div class="CodeModel">
            <td><p5></p5></td>
        </div>
    </tr>

    <tr>
        <td>
            <center>
                <button id="VentilateModel_btn" type="button" style="height:38px;width:140px;">通风模式</button>
            </center>
        </td>
        <div class="VentilateModel">
            <td><p6></p6></td>
        </div>
    </tr>

    <tr>
        <td>
            <center>
                <button id="DehumidifyModel_btn" type="button" style="height:38px;width:140px;">除湿模式</button>
            </center>
        </td>
        <div class="DehumidifyModel">
            <td><p7></p7></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="BootModel_btn" type="button" style="height:38px;width:140px;">开机模式</button>
            </center>
        </td>
        <div class="BootModel">
            <td><p8></p8></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="PowerOffModel_btn" type="button" style="height:38px;width:140px;">关机模式</button>
            </center>
        </td>
        <div class="PowerOffModel">
            <td><p9></p9></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="WindSweepLeftRight_btn" type="button" style="height:38px;width:140px;">左右扫风模式</button>
            </center>
        </td>
        <div class="WindSweepLeftRight">
            <td><p10></p10></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="WindSweepUpDown_btn" type="button" style="height:38px;width:140px;">上下扫风模式</button>
            </center>
        </td>
        <div class="WindSweepUpDown">
            <td><p11></p11></td>
        </div>
    </tr>
    <tr>
        <td>
            <center>
                <button id="AutoModel_btn" type="button" style="height:38px;width:140px;">自动模式</button>
            </center>
        </td>
        <div class="AutoModel">
            <td><p12></p12></td>
        </div>
    </tr>
    <br>
    <tr>
        <td>
            <center>
                <div id="DefaultCode_TAG">编码模板</div>
            </center>
        </td>
        <td><center><input type="text" class=text id="DefaultCode"></center></td>
    </tr>
</table>
</div>
</div>
</section>
</section>
</section>
</body>


<script>
var RemoteData = {{.RemoteData}}
$(document).ready(function () {
    id = 0;
    id1 = 0;
    id2 = 0;
    id3 = 0;
    id4 = 0;
    id5 = 0;
    id6 = 0;
    id7 = 0;
    id8 = 0;
    id9 = 0;
    id10 = 0;
    id11 = 0;
    id12 = 0;
    accode_id0 = 0;
    accode_id1 = 0;
    accode_id2 = 0;
    accode_id3 = 0;
    accode_id4 = 0;
    accode_id5 = 0;
    accode_id6 = 0;
    accode_id7 = 0;
    accode_id8 = 0;
    accode_id9 = 0;
    accode_id10 = 0;
    accode_id11 = 0;
    accode_id12 = 0;
    accode_id13 = 0;
    accode_id14 = 0;
    accode_id15 = 0;
    accode_id16 = 0;

    $("#RemoteName").val(RemoteData.RemoteName);
    $("#No").val(RemoteData.No);
    $("#Version").val(RemoteData.Version);
    parseInt($("#DeviceType").val(RemoteData.DeviceType));
    parseInt($("#TimeScale").val(RemoteData.TimeScale));
    parseInt($("#IRFRQ").val(RemoteData.IRFRQ));
    $("#BootCode").val(RemoteData.BootCode);
    $("#PoweroffCode").val(RemoteData.PoweroffCode);
    $("#Special_S").val(RemoteData.S);
    $("#Special_A").val(RemoteData.A);
    $("#Special_B").val(RemoteData.B);
    $("#Special_C").val(RemoteData.C);
    $("#Special_D").val(RemoteData.D);
    $("#Special_E").val(RemoteData.E);
    $("#Special_One").val(RemoteData.One);
    $("#Special_Zero").val(RemoteData.Zero);
    $("#DefaultCode").val(RemoteData.AcCode.DefaultCode);
    //获取温度16-32度数据
    var temp_data_array = RemoteData.AcCode.TemperatureData;
    for (var i = 0; i < temp_data_array.length; i++) {
        for (var j = 0; j < temp_data_array[i].length; j++) {
            var id_str = "id" + (10+6 + i)+"_";
            var id_t = 16 + i;
            str = "accode_id"+i;

            accode_id = eval(str);
            $("p" + id_t).append('<div><input type=text id=' + id_str + accode_id + '_0' + ' class="text AA"><input type=text id=' + id_str + accode_id + '_1' + ' class="text AA"><input type=text id=' + id_str + accode_id + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
            $("#" + id_str + accode_id+"_0").val(RemoteData.AcCode.TempSart[i][j] );
            $("#" + id_str + accode_id+"_1").val(RemoteData.AcCode.TemperatureData[i][j]);
            $("#" + id_str + accode_id+"_2").val(RemoteData.AcCode.TempBitLen[i][j]);
            console.log("str+'++'")
            console.log(eval(str));
            eval(str+'++');
            console.log(eval(str));

        }
    }
    //获取各种模式数据
    //风速自动模式
    for (var i = 0;i < RemoteData.AcCode.WindAutoModel.StartAddr.length;i++)
    {
        $("p").append('<div><input type=text id= id_' + id + '_0' + ' class="text AA"><input type=text id= id_' + id + '_1' + ' class="text AA"><input type=text id= id_' + id + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id_" + id + "_0").val(RemoteData.AcCode.WindAutoModel.StartAddr[i]);
        $("#id_" + id + "_1").val(RemoteData.AcCode.WindAutoModel.Code[i]);
        $("#id_" + id + "_2").val(RemoteData.AcCode.WindAutoModel.BitLength[i]);
        id++;
    }
    //风速高模式
    for (var i = 0;i < RemoteData.AcCode.WindHighModel.StartAddr.length;i++)
    {
        $("p1").append('<div><input type=text id= id1_' + id1 + '_0' + ' class="text AA"><input type=text id= id1_' + id1 + '_1' + ' class="text AA"><input type=text id= id1_' + id1 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id1_" + id1 + "_0").val(RemoteData.AcCode.WindHighModel.StartAddr[i]);
        $("#id1_" + id1 + "_1").val(RemoteData.AcCode.WindHighModel.Code[i]);
        $("#id1_" + id1 + "_2").val(RemoteData.AcCode.WindHighModel.BitLength[i]);
        id1++;
    }
    //风速中模式
    for (var i = 0;i < RemoteData.AcCode.WindMidModel.StartAddr.length;i++)
    {
        $("p2").append('<div><input type=text id= id2_' + id2 + '_0' + ' class="text AA"><input type=text id= id2_' + id2 + '_1' + ' class="text AA"><input type=text id= id2_' + id2 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id2_" + id2 + "_0").val(RemoteData.AcCode.WindMidModel.StartAddr[i]);
        $("#id2_" + id2 + "_1").val(RemoteData.AcCode.WindMidModel.Code[i]);
        $("#id2_" + id2 + "_2").val(RemoteData.AcCode.WindMidModel.BitLength[i]);
        id2++;
    }
    //风速低模式
    for (var i = 0;i < RemoteData.AcCode.WindLowModel.StartAddr.length;i++)
    {
        $("p3").append('<div><input type=text id= id3_' + id3 + '_0' + ' class="text AA"><input type=text id= id3_' + id3 + '_1' + ' class="text AA"><input type=text id= id3_' + id3 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id3_" + id3 + "_0").val(RemoteData.AcCode.WindLowModel.StartAddr[i]);
        $("#id3_" + id3 + "_1").val(RemoteData.AcCode.WindLowModel.Code[i]);
        $("#id3_" + id3 + "_2").val(RemoteData.AcCode.WindLowModel.BitLength[i]);
        id3++;
    }
    //制热模式
    for (var i = 0;i < RemoteData.AcCode.HotModel.StartAddr.length;i++)
    {
        $("p4").append('<div><input type=text id= id4_' + id4 + '_0' + ' class="text AA"><input type=text id= id4_' + id4 + '_1' + ' class="text AA"><input type=text id= id4_' + id4 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id4_" + id4 + "_0").val(RemoteData.AcCode.HotModel.StartAddr[i]);
        $("#id4_" + id4 + "_1").val(RemoteData.AcCode.HotModel.Code[i]);
        $("#id4_" + id4 + "_2").val(RemoteData.AcCode.HotModel.BitLength[i]);
        id4++;
    }
    //制冷模式
    for (var i = 0;i < RemoteData.AcCode.CodeModel.StartAddr.length;i++)
    {
        $("p5").append('<div><input type=text id= id5_' + id5 + '_0' + ' class="text AA"><input type=text id= id5_' + id5 + '_1' + ' class="text AA"><input type=text id= id5_' + id5 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id5_" + id5 + "_0").val(RemoteData.AcCode.CodeModel.StartAddr[i]);
        $("#id5_" + id5 + "_1").val(RemoteData.AcCode.CodeModel.Code[i]);
        $("#id5_" + id5 + "_2").val( RemoteData.AcCode.CodeModel.BitLength[i]);
        id5++;
    }
    //通风模式
    for (var i = 0;i < RemoteData.AcCode.VentilateModel.StartAddr.length;i++)
    {
        $("p6").append('<div><input type=text id= id6_' + id6 + '_0' + ' class="text AA"><input type=text id= id6_' + id6 + '_1' + ' class="text AA"><input type=text id= id6_' + id6 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id6_" + id6 + "_0").val(RemoteData.AcCode.VentilateModel.StartAddr[i]);
        $("#id6_" + id6 + "_1").val(RemoteData.AcCode.VentilateModel.Code[i]);
        $("#id6_" + id6 + "_2").val(RemoteData.AcCode.VentilateModel.BitLength[i]);
        id6++;
    }
    //除湿模式
    for (var i = 0;i < RemoteData.AcCode.DehumidifyModel.StartAddr.length;i++)
    {
        $("p7").append('<div><input type=text id= id7_' + id7 + '_0' + ' class="text AA"><input type=text id= id7_' + id7 + '_1' + ' class="text AA"><input type=text id= id7_' + id7 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id7_" + id7 + "_0").val(RemoteData.AcCode.DehumidifyModel.StartAddr[i]);
        $("#id7_" + id7 + "_1").val(RemoteData.AcCode.DehumidifyModel.Code[i]);
        $("#id7_" + id7 + "_2").val(RemoteData.AcCode.DehumidifyModel.BitLength[i]);
        id7++;
    }
    //开机模式
    for (var i = 0;i < RemoteData.AcCode.BootModel.StartAddr.length;i++)
    {
        $("p8").append('<div><input type=text id= id8_' + id8 + '_0' + ' class="text AA"><input type=text id= id8_' + id8 + '_1' + ' class="text AA"><input type=text id= id8_' + id8 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id8_" + id8 + "_0").val(RemoteData.AcCode.BootModel.StartAddr[i]);
        $("#id8_" + id8 + "_1").val(RemoteData.AcCode.BootModel.Code[i]);
        $("#id8_" + id8 + "_2").val(RemoteData.AcCode.BootModel.BitLength[i]);
        id8++;
    }
    //关机模式
    for (var i = 0;i < RemoteData.AcCode.PowerOffModel.StartAddr.length;i++)
    {
        $("p9").append('<div><input type=text id= id9_' + id9 + '_0' + ' class="text AA"><input type=text id= id9_' + id9 + '_1' + ' class="text AA"><input type=text id= id9_' + id9 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id9_" + id9 + "_0").val(RemoteData.AcCode.PowerOffModel.StartAddr[i]);
        $("#id9_" + id9 + "_1").val(RemoteData.AcCode.PowerOffModel.Code[i]);
        $("#id9_" + id9 + "_2").val(RemoteData.AcCode.PowerOffModel.BitLength[i]);
        id9++;
    }
    //左右扫风模式
    for (var i = 0;i < RemoteData.AcCode.WindSweepLeftRight.StartAddr.length;i++)
    {
        $("p10").append('<div><input type=text id= id10_' + id10 + '_0' + ' class="text AA"><input type=text id= id10_' + id10 + '_1' + ' class="text AA"><input type=text id= id10_' + id10 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id10_" + id10 + "_0").val(RemoteData.AcCode.WindSweepLeftRight.StartAddr[i]);
        $("#id10_" + id10 + "_1").val(RemoteData.AcCode.WindSweepLeftRight.Code[i]);
        $("#id10_" + id10 + "_2").val(RemoteData.AcCode.WindSweepLeftRight.BitLength[i]);
        id10++;
    }
    //上下扫风模式
    for (var i = 0;i < RemoteData.AcCode.WindSweepUpDown.StartAddr.length;i++)
    {
        $("p11").append('<div><input type=text id= id11_' + id11 + '_0' + ' class="text AA"><input type=text id= id11_' + id11 + '_1' + ' class="text AA"><input type=text id= id11_' + id11 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        $("#id11_" + id11 + "_0").val(RemoteData.AcCode.WindSweepUpDown.StartAddr[i]);
        $("#id11_" + id11 + "_1").val(RemoteData.AcCode.WindSweepUpDown.Code[i]);
        $("#id11_" + id11 + "_2").val(RemoteData.AcCode.WindSweepUpDown.BitLength[i]);
        id11++;
    }
    //自动模式
    for (var i = 0;i < RemoteData.AcCode.AutoModel.StartAddr.length;i++)
    {
        console.log("RemoteData.AcCode.AutoModel.StartAddr[i]");
        console.log(RemoteData.AcCode.AutoModel.StartAddr[i]);
        console.log(id12);

        $("p12").append('<div><input type=text id= id12_' + id12 + '_0' + ' class="text AA"><input type=text id= id12_' + id12 + '_1' + ' class="text AA"><input type=text id= id12_' + id12 + '_2' + ' class="text AA"><a href="#" class="removeclass">×</a></div> ');

        $("#id12_" + id12 + "_0").val(RemoteData.AcCode.AutoModel.StartAddr[i]);
        $("#id12_" + id12 + "_1").val(RemoteData.AcCode.AutoModel.Code[i]);
        $("#id12_" + id12 + "_2").val(RemoteData.AcCode.AutoModel.BitLength[i]);
        id12++;
    }

//手动添加16-32度各温度的开始的位数，码值，位宽
    //温度16度
    $("#Temp16_btn").click(function(){
        $("p16").append('<div class="accode_id"><input type=text id= id16_'+accode_id+'_0'+' class="text AA"><input type=text id= id16_'+accode_id+'_1'+' class="text AA"><input type=text id= id16_'+accode_id+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id++;
    });
    //温度17度
    $("#Temp17_btn").click(function(){
        $("p17").append('<div class="accode_id1"><input type=text id= id17_'+accode_id1+'_0'+' class="text AA"><input type=text id= id17_'+accode_id1+'_1'+' class="text AA"><input type=text id= id17_'+accode_id1+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id1++;
    });
    //温度18度
    $("#Temp18_btn").click(function(){
        $("p18").append('<div class="accode_id2"><input type=text id= id18_'+accode_id2+'_0'+' class="text AA"><input type=text id= id18_'+accode_id2+'_1'+' class="text AA"><input type=text id= id18_'+accode_id2+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id2++;
    });
    //温度19度
    $("#Temp19_btn").click(function(){
        $("p19").append('<div class="accode_id3"><input type=text id= id19_'+accode_id3+'_0'+' class="text AA"><input type=text id= id19_'+accode_id3+'_1'+' class="text AA"><input type=text id= id19_'+accode_id3+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id3++;
    });
    //温度20度
    $("#Temp20_btn").click(function(){
        $("p20").append('<div class="accode_id4"><input type=text id= id20_'+accode_id4+'_0'+' class="text AA"><input type=text id= id20_'+accode_id4+'_1'+' class="text AA"><input type=text id= id20_'+accode_id4+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id4++;
    });
    //温度21度
    $("#Temp21_btn").click(function(){
        $("p21").append('<div class="accode_id5"><input type=text id= id21_'+accode_id5+'_0'+' class="text AA"><input type=text id= id21_'+accode_id5+'_1'+' class="text AA"><input type=text id= id21_'+accode_id5+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id5++;
    });
    //温度22度
    $("#Temp22_btn").click(function(){
        $("p22").append('<div class="accode_id6"><input type=text id= id22_'+accode_id6+'_0'+' class="text AA"><input type=text id= id22_'+accode_id6+'_1'+' class="text AA"><input type=text id= id22_'+accode_id6+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id6++;
    });
    //温度23度
    $("#Temp23_btn").click(function(){
        $("p23").append('<div class="accode_id7"><input type=text id= id23_'+accode_id7+'_0'+' class="text AA"><input type=text id= id23_'+accode_id7+'_1'+' class="text AA"><input type=text id= id23_'+accode_id7+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id7++;
    });
    //温度24度
    $("#Temp24_btn").click(function(){
        $("p24").append('<div class="accode_id8"><input type=text id= id24_'+accode_id8+'_0'+' class="text AA"><input type=text id= id24_'+accode_id8+'_1'+' class="text AA"><input type=text id= id24_'+accode_id8+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id8++;
    });
    //温度25度
    $("#Temp25_btn").click(function(){
        $("p25").append('<div class="accode_id9"><input type=text id= id25_'+accode_id9+'_0'+' class="text AA"><input type=text id= id25_'+accode_id9+'_1'+' class="text AA"><input type=text id= id25_'+accode_id9+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id9++;
    });
    //温度26度
    $("#Temp26_btn").click(function(){
        $("p26").append('<div class="accode_id10"><input type=text id= id26_'+accode_id10+'_0'+' class="text AA"><input type=text id= id26_'+accode_id10+'_1'+' class="text AA"><input type=text id= id26_'+accode_id10+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id10++;
    });
    //温度27度
    $("#Temp27_btn").click(function(){
        $("p27").append('<div class="accode_id11"><input type=text id= id27_'+accode_id11+'_0'+' class="text AA"><input type=text id= id27_'+accode_id11+'_1'+' class="text AA"><input type=text id= id27_'+accode_id11+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id11++;
    });
    //温度28度
    $("#Temp28_btn").click(function(){
        $("p28").append('<div class="accode_id12"><input type=text id= id28_'+accode_id12+'_0'+' class="text AA"><input type=text id= id28_'+accode_id12+'_1'+' class="text AA"><input type=text id= id28_'+accode_id12+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id12++;
    });
    //温度29度
    $("#Temp29_btn").click(function(){
        $("p29").append('<div class="accode_id13"><input type=text id= id29_'+accode_id13+'_0'+' class="text AA"><input type=text id= id29_'+accode_id13+'_1'+' class="text AA"><input type=text id= id29_'+accode_id13+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id13++;
    });
    //温度30度
    $("#Temp30_btn").click(function(){
        $("p30").append('<div class="accode_id14"><input type=text id= id30_'+accode_id14+'_0'+' class="text AA"><input type=text id= id30_'+accode_id14+'_1'+' class="text AA"><input type=text id= id30_'+accode_id14+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id14++;
    });
    //温度31度
    $("#Temp31_btn").click(function(){
        $("p31").append('<div class="accode_id15"><input type=text id= id31_'+accode_id15+'_0'+' class="text AA"><input type=text id= id31_'+accode_id15+'_1'+' class="text AA"><input type=text id= id31_'+accode_id15+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id15++;
    });
    //温度32度
    $("#Temp32_btn").click(function(){
        $("p32").append('<div class="accode_id16"><input type=text id= id32_'+accode_id16+'_0'+' class="text AA"><input type=text id= id32_'+accode_id16+'_1'+' class="text AA"><input type=text id= id32_'+accode_id16+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        accode_id16++;
    });

//手动添加各种模式的开始的位数，码值，位宽
    //风速自动模式
    $("#WindAutoModel_btn").click(function(){
        $("p").append('<div class="id"><input type=text id= id_'+id+'_0'+' class="text AA"><input type=text id= id_'+id+'_1'+' class="text AA"><input type=text id= id_'+id+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id ++;
    });
    //风速高模式
    $("#WindHighModel_btn").click(function(){
        $("p1").append('<div class="id1"><input type=text id= id1_'+id1+'_0'+' class="text AA"><input type=text id= id1_'+id1+'_1'+' class="text AA"><input type=text id= id1_'+id1+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id1++;
    });
    //风速中模式
    $("#WindMidModel_btn").click(function(){
        $("p2").append('<div class="id2"><input type=text id= id2_'+id2+'_0'+' class="text AA"><input type=text id= id2_'+id2+'_1'+' class="text AA"><input type=text id= id2_'+id2+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id2++;
    });
    //风速低模式
    $("#WindLowModel_btn").click(function(){
        $("p3").append('<div class="id3"><input type=text id= id3_'+id3+'_0'+' class="text AA"><input type=text id= id3_'+id3+'_1'+' class="text AA"><input type=text id= id3_'+id3+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id3++;
    });
    //制热模式
    $("#HotModel_btn").click(function(){
        $("p4").append('<div class="id4"><input type=text id= id4_'+id4+'_0'+' class="text AA"><input type=text id= id4_'+id4+'_1'+' class="text AA"><input type=text id= id4_'+id4+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id4++;
    });
    //制冷模式
    $("#CodeModel_btn").click(function(){
        $("p5").append('<div class="id5"><input type=text id= id5_'+id5+'_0'+' class="text AA"><input type=text id= id5_'+id5+'_1'+' class="text AA"><input type=text id= id5_'+id5+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id5++;
    });
    //通风模式
    $("#VentilateModel_btn").click(function(){
        $("p6").append('<div class="id6"><input type=text id= id6_'+id6+'_0'+' class="text AA"><input type=text id= id6_'+id6+'_1'+' class="text AA"><input type=text id= id6_'+id6+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id6++;
    });
    //除湿模式
    $("#DehumidifyModel_btn").click(function(){
        $("p7").append('<div class="id7"><input type=text id= id7_'+id7+'_0'+' class="text AA"><input type=text id= id7_'+id7+'_1'+' class="text AA"><input type=text id= id7_'+id7+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id7++;
    });
    //开机模式
    $("#BootModel_btn").click(function(){
        $("p8").append('<div class="id8"><input type=text id= id8_'+id8+'_0'+' class="text AA"><input type=text id= id8_'+id8+'_1'+' class="text AA"><input type=text id= id8_'+id8+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id8++;
    });
    //关机模式
    $("#PowerOffModel_btn").click(function(){
        $("p9").append('<div class="id9"><input type=text id= id9_'+id9+'_0'+' class="text AA"><input type=text id= id9_'+id9+'_1'+' class="text AA"><input type=text id= id9_'+id9+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id9++;
    });
    //左右扫风模式
    $("#WindSweepLeftRight_btn").click(function(){
        $("p10").append('<div class="id10"><input type=text id= id10_'+id10+'_0'+' class="text AA"><input type=text id= id10_'+id10+'_1'+' class="text AA"><input type=text id= id10_'+id10+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id10++;
    });
    //上下扫风模式
    $("#WindSweepUpDown_btn").click(function(){
        $("p11").append('<div class="id11"><input type=text id= id11_'+id11+'_0'+' class="text AA"><input type=text id= id11_'+id11+'_1'+' class="text AA"><input type=text id= id11_'+id11+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id11++;
    });
    //自动模式
    $("#AutoModel_btn").click(function(){
        $("p12").append('<div class="id12"><input type=text id= id12_'+id12+'_0'+' class="text AA"><input type=text id= id12_'+id12+'_1'+' class="text AA"><input type=text id= id12_'+id12+'_2'+' class="text AA"><a href="#" class="removeclass">×</a></div> ');
        id12++;
    });

//手动删除输入框
    $("body").on("click",".removeclass", function(e){
        $(this).parent('div').remove();
        _id = $(this).parent('div').attr('class')+'--';
        eval(_id)

    })


//判断输入框数据类型是否为int型
    //设备型号的判断
    var DeviceTypeFlag = 0;
    $("#DeviceType").focus(function () {
        DeviceTypeFlag = 0;
        $("#DeviceTypeLabel").hide();
    });

    $("#DeviceType").blur(function () {
        var DeviceTypeFlag = 0;
        var a = $("#DeviceType").val();
        if (!/^[0-9]*$/.test(a)) {

            $("#DeviceTypeLabel").show();
            DeviceTypeFlag = 1;
        }
    });

    //载波频率的判断
    var IRFRQFlag = 0;
    $("#IRFRQ").focus(function () {
        IRFRQFlag = 0;
        $("#IRFRQLabel").hide();
    });

    $("#IRFRQ").blur(function () {
        var IRFRQFlag = 0;
        var a = $("#IRFRQ").val();
        if (!/^[0-9]*$/.test(a)) {

            $("#IRFRQLabel").show();
            IRFRQFlag = 1
        }
    });
    //采样脉冲宽度的判断
    var TimeScaleFlag = 0;
    $("#TimeScale").focus(function () {
        TimeScaleFlag = 0;
        $("#TimeScaleLabel").hide();
    });

    $("#TimeScale").blur(function () {
        var TimeScaleFlag = 0;
        var a = $("#TimeScale").val();
        if (!/^[0-9]*$/.test(a)) {

            $("#TimeScaleLabel").show();
            TimeScaleFlag = 1;
        }
    });
    function get_data() {
        var json_data = {
            "ObjectId": "548d0955e360662cfd000001",
            "RemoteName": "",
            "No": "",
            "Version": "",
            "DeviceType": 0,
            "Descript": "",
            "SaveUrl": "",
            "User": 1,
            "UpdateTime": "0001-01-01T00:00:00Z",
            "TimeScale": 0,
            "IRFRQ": 0,
            "One": "",
            "Zero": "",
            "S": "",
            "A": "",
            "B": "",
            "C": "",
            "D": "",
            "E": "",

            "BootCode": "",
            "PoweroffCode": "",
            "MatchCode": [],
            "AcCode": {
                "TemperatureData": [],
                "TempSart": [],
                "TempBitLen": [],
                "PowerOffModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },
                "BootModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },

                "WindSweepLeftRight": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },

                "WindSweepUpDown": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },

                "WindAutoModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },
                "AutoModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },
                "WindHighModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },
                "WindMidModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },
                "WindLowModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },
                "HotModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },

                "CodeModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },
                "VentilateModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },
                "DehumidifyModel": {
                    "StartAddr": [],
                    "Code": [],
                    "BitLength": []
                },
                "DefaultCode": ""
            },
            "CommonCode": []



        }

        json_data.RemoteName = $("#RemoteName").val();
        json_data.No = $("#No").val();
        json_data.Version = $("#Version").val();
        json_data.DeviceType = parseInt($("#DeviceType").val());
        //json_data.SaveUrl=$("#SaveUrl").val();
        //json_data.User=parseInt($("#User").val());
        //json_data.UpdateTime=$("#UpdateTime").val();
        json_data.TimeScale = parseInt($("#TimeScale").val());
        json_data.IRFRQ = parseInt($("#IRFRQ").val());
        json_data.BootCode = $("#BootCode").val();
        json_data.PoweroffCode = $("#PoweroffCode").val();
        json_data.S = $("#Special_S").val();
        json_data.A = $("#Special_A").val();
        json_data.B = $("#Special_B").val();
//            console.log("b");
//            console.log($("#Special_B").val());
        json_data.C = $("#Special_C").val();
        json_data.D = $("#Special_D").val();
        json_data.E = $("#Special_E").val();
        json_data.One = $("#Special_One").val();
        json_data.Zero = $("#Special_Zero").val();
        json_data.AcCode.DefaultCode = $("#DefaultCode").val();

        for (var i = 0; i < 16; i++) {
            var temp_16 = $("input[id^='id" + (16 + i) + "_']");
            var sec_str = "#id" + (16 + i) + "_"
            console.log("sec_str:" + sec_str);
            var temp_start = []
            var temp_code = []
            var temp_bitlen = []
            console.log("temp_16.length:" + temp_16.length)
            if (temp_16.length == 0) {
                json_data.AcCode.TempSart.push([0])
                json_data.AcCode.TemperatureData.push(["0"])
                json_data.AcCode.TempBitLen.push([0])
            } else {


                for (var j = 0; j < temp_16.length / 3; j++) {

                    if (($(sec_str + j + "_2").val() == '') && ($(sec_str + j + "_0").val() == '') && ($(sec_str + j + "_1").val() == '')) {
                        alert("不能为空")
                        return [0, 0, 0]
                        //event.preventDefault();
                    }
                    temp_start.push(parseInt($(sec_str + j + "_0").val()));
                    temp_code.push($(sec_str + j + "_1").val());
                    temp_bitlen.push(parseInt($(sec_str + j + "_2").val()));
                }
                json_data.AcCode.TempSart.push(temp_start)
                json_data.AcCode.TemperatureData.push(temp_code)
                json_data.AcCode.TempBitLen.push(temp_bitlen)
                //console.log(json_data)

            }
        }
        //json取AcCode格式中各模式的数据
        //风速自动模式
        var model_WindAuto = $("input[id^='id_']");
        console.log($("input[id^='id_']"));
        if (model_WindAuto.length == 0) {
            json_data.AcCode.WindAutoModel.StartAddr.push(0)
            json_data.AcCode.WindAutoModel.Code.push("0")
            json_data.AcCode.WindAutoModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_WindAuto.length / 3; j++) {
                if (($("#id_" + j + "_0").val() == '') && ($("#id_" + j + "_1").val() == '') && ($("#id_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.WindAutoModel.StartAddr.push(parseInt($("#id_" + j + "_0").val()))
                json_data.AcCode.WindAutoModel.Code.push($("#id_" + j + "_1").val())
                json_data.AcCode.WindAutoModel.BitLength.push(parseInt($("#id_" + j + "_2").val()))
            }
        }
        //风速高模式
        var model_WindHigh = $("input[id^='id1_']");
        console.log($("input[id^='id1_']"));
        if (model_WindHigh.length == 0) {
            json_data.AcCode.WindHighModel.StartAddr.push(0)
            json_data.AcCode.WindHighModel.Code.push("0")
            json_data.AcCode.WindHighModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_WindHigh.length / 3; j++) {
                if (($("#id1_" + j + "_0").val() == '') && ($("#id1_" + j + "_1").val() == '') && ($("#id1_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.WindHighModel.StartAddr.push(parseInt($("#id1_" + j + "_0").val()))
                json_data.AcCode.WindHighModel.Code.push($("#id1_" + j + "_1").val())
                json_data.AcCode.WindHighModel.BitLength.push(parseInt($("#id1_" + j + "_2").val()))

            }
        }
        //风速中模式
        var model_WindMid = $("input[id^='id2_']");

        console.log($("input[id^='id2_']"));
        if (model_WindMid.length == 0) {
            json_data.AcCode.WindMidModel.StartAddr.push(0)
            json_data.AcCode.WindMidModel.Code.push("0")
            json_data.AcCode.WindMidModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_WindMid.length / 3; j++) {
                if (($("#id2_" + j + "_0").val() == '') && ($("#id2_" + j + "_1").val() == '') && ($("#id2_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.WindMidModel.StartAddr.push(parseInt($("#id2_" + j + "_0").val()))
                json_data.AcCode.WindMidModel.Code.push($("#id2_" + j + "_1").val())
                json_data.AcCode.WindMidModel.BitLength.push(parseInt($("#id2_" + j + "_2").val()))

            }
        }
        //风速低模式
        var model_WindLow = $("input[id^='id3_']");
        console.log($("input[id^='id3_']"));
        if (model_WindLow.length == 0) {
            json_data.AcCode.WindLowModel.StartAddr.push(0)
            json_data.AcCode.WindLowModel.Code.push("0")
            json_data.AcCode.WindLowModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_WindLow.length / 3; j++) {
                if (($("#id3_" + j + "_0").val() == '') && ($("#id3_" + j + "_1").val() == '') && ($("#id3_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.WindLowModel.StartAddr.push(parseInt($("#id3_" + j + "_0").val()))
                json_data.AcCode.WindLowModel.Code.push($("#id3_" + j + "_1").val())
                json_data.AcCode.WindLowModel.BitLength.push(parseInt($("#id3_" + j + "_2").val()))

            }
        }
        //制热模式
        var model_Hot = $("input[id^='id4_']");
        console.log($("input[id^='id4_']"));
        if (model_Hot.length == 0) {
            json_data.AcCode.HotModel.StartAddr.push(0)
            json_data.AcCode.HotModel.Code.push("0")
            json_data.AcCode.HotModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_Hot.length / 3; j++) {
                if (($("#id4_" + j + "_0").val() == '') && ($("#id4_" + j + "_1").val() == '') && ($("#id4_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.HotModel.StartAddr.push(parseInt($("#id4_" + j + "_0").val()))
                json_data.AcCode.HotModel.Code.push($("#id4_" + j + "_1").val())
                json_data.AcCode.HotModel.BitLength.push(parseInt($("#id4_" + j + "_2").val()))
            }
        }
        //制冷模式
        var model_Code = $("input[id^='id5_']");
        console.log($("input[id^='id5_']"));
        if (model_Code.length == 0) {
            json_data.AcCode.CodeModel.StartAddr.push(0)
            json_data.AcCode.CodeModel.Code.push("0")
            json_data.AcCode.CodeModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_Code.length / 3; j++) {
                if (($("#id5_" + j + "_0").val() == '') && ($("#id5_" + j + "_1").val() == '') && ($("#id5_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.CodeModel.StartAddr.push(parseInt($("#id5_" + j + "_0").val()))
                json_data.AcCode.CodeModel.Code.push($("#id5_" + j + "_1").val())
                json_data.AcCode.CodeModel.BitLength.push(parseInt($("#id5_" + j + "_2").val()))
            }
        }
        //通风模式
        var model_Ventilate = $("input[id^='id6_']");
        console.log($("input[id^='id6_']"));
        if (model_Ventilate.length == 0) {
            json_data.AcCode.VentilateModel.StartAddr.push(0)
            json_data.AcCode.VentilateModel.Code.push("0")
            json_data.AcCode.VentilateModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_Ventilate.length / 3; j++) {
                if (($("#id6_" + j + "_0").val() == '') && ($("#id6_" + j + "_1").val() == '') && ($("#id6_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.VentilateModel.StartAddr.push(parseInt($("#id6_" + j + "_0").val()))
                json_data.AcCode.VentilateModel.Code.push($("#id6_" + j + "_1").val())
                json_data.AcCode.VentilateModel.BitLength.push(parseInt($("#id6_" + j + "_2").val()))
            }
        }
        //除湿模式
        var model_Dehumidify = $("input[id^='id7_']");
        console.log($("input[id^='id7_']"));
        if (model_Dehumidify.length == 0) {
            json_data.AcCode.DehumidifyModel.StartAddr.push(0)
            json_data.AcCode.DehumidifyModel.Code.push("0")
            json_data.AcCode.DehumidifyModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_Dehumidify.length / 3; j++) {
                if (($("#id7_" + j + "_0").val() == '') && ($("#id7_" + j + "_1").val() == '') && ($("#id7_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.DehumidifyModel.StartAddr.push(parseInt($("#id7_" + j + "_0").val()))
                json_data.AcCode.DehumidifyModel.Code.push($("#id7_" + j + "_1").val())
                json_data.AcCode.DehumidifyModel.BitLength.push(parseInt($("#id7_" + j + "_2").val()))
            }
        }
        //开机模式
        var model_Boot = $("input[id^='id8_']");
        console.log($("input[id^='id8_']"));
        if (model_Boot.length == 0) {
            json_data.AcCode.BootModel.StartAddr.push(0)
            json_data.AcCode.BootModel.Code.push("0")
            json_data.AcCode.BootModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_Boot.length / 3; j++) {
                if (($("#id8_" + j + "_0").val() == '') && ($("#id8_" + j + "_1").val() == '') && ($("#id8_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.BootModel.StartAddr.push(parseInt($("#id8_" + j + "_0").val()))
                json_data.AcCode.BootModel.Code.push($("#id8_" + j + "_1").val())
                json_data.AcCode.BootModel.BitLength.push(parseInt($("#id8_" + j + "_2").val()))
            }
        }
        //关机模式
        var model_PowerOff = $("input[id^='id9_']");
        console.log($("input[id^='id9_']"));
        if (model_PowerOff.length == 0) {
            json_data.AcCode.PowerOffModel.StartAddr.push(0)
            json_data.AcCode.PowerOffModel.Code.push("0")
            json_data.AcCode.PowerOffModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_PowerOff.length / 3; j++) {
                if (($("#id9_" + j + "_0").val() == '') && ($("#id9_" + j + "_1").val() == '') && ($("#id9_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.PowerOffModel.StartAddr.push(parseInt($("#id9_" + j + "_0").val()))
                json_data.AcCode.PowerOffModel.Code.push($("#id9_" + j + "_1").val())
                json_data.AcCode.PowerOffModel.BitLength.push(parseInt($("#id9_" + j + "_2").val()))
            }
        }
        //左右扫风模式
        var model_WindSweepLeftRight = $("input[id^='id10_']");
        console.log($("input[id^='id10_']"));
        if (model_WindSweepLeftRight.length == 0) {
            json_data.AcCode.WindSweepLeftRight.StartAddr.push(0)
            json_data.AcCode.WindSweepLeftRight.Code.push("0")
            json_data.AcCode.WindSweepLeftRight.BitLength.push(0)
        } else {
            for (var j = 0; j < model_WindSweepLeftRight.length / 3; j++) {
                if (($("#id10_" + j + "_0").val() == '') && ($("#id10_" + j + "_1").val() == '') && ($("#id10_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.WindSweepLeftRight.StartAddr.push(parseInt($("#id10_" + j + "_0").val()))
                json_data.AcCode.WindSweepLeftRight.Code.push($("#id10_" + j + "_1").val())
                json_data.AcCode.WindSweepLeftRight.BitLength.push(parseInt($("#id10_" + j + "_2").val()))
            }
        }
        //上下扫风模式
        var model_WindSweepUpDown = $("input[id^='id11_']");
        console.log($("input[id^='id11_']"));
        if (model_WindSweepUpDown.length == 0) {
            json_data.AcCode.WindSweepUpDown.StartAddr.push(0)
            json_data.AcCode.WindSweepUpDown.Code.push("0")
            json_data.AcCode.WindSweepUpDown.BitLength.push(0)
        } else {
            for (var j = 0; j < model_WindSweepUpDown.length / 3; j++) {
                if (($("#id11_" + j + "_0").val() == '') && ($("#id11_" + j + "_1").val() == '') && ($("#id11_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.WindSweepUpDown.StartAddr.push(parseInt($("#id11_" + j + "_0").val()))
                json_data.AcCode.WindSweepUpDown.Code.push($("#id11_" + j + "_1").val())
                json_data.AcCode.WindSweepUpDown.BitLength.push(parseInt($("#id11_" + j + "_2").val()))
            }
        }
        //自动模式
        var model_Auto = $("input[id^='id12_']");
        console.log($("input[id^='id12_']"));
        if (model_Auto.length == 0) {
            json_data.AcCode.AutoModel.StartAddr.push(0)
            json_data.AcCode.AutoModel.Code.push("0")
            json_data.AcCode.AutoModel.BitLength.push(0)
        } else {
            for (var j = 0; j < model_Auto.length / 3; j++) {
                if (($("#id12_" + j + "_0").val() == '') && ($("#id12_" + j + "_1").val() == '') && ($("#id12_" + j + "_2").val() == '')) {
                    alert("不能为空")
                    return [0, 0, 0]
                }
                json_data.AcCode.AutoModel.StartAddr.push(parseInt($("#id12_" + j + "_0").val()))
                json_data.AcCode.AutoModel.Code.push($("#id12_" + j + "_1").val())
                json_data.AcCode.AutoModel.BitLength.push(parseInt($("#id12_" + j + "_2").val()))
            }
        }

        return [1, json_data, 0]
    }

        //json取输入框数据
    $("#submit_btn").click(function () {
        data = get_data();
        if (data[0] == 1) {
            console.log("ok")
            console.log(data[1]);
            $.ajax({
                type: "POST",
                url: 'http://' + window.location.host + '/admin/update_remote/{{.tel}}/'+RemoteData.ObjectId,
                data: JSON.stringify(data[1]),
                datatype: "json",
                success: function (data) {
                    if (data.RespCode == 200) {
                        alert(data.Msg);
                    } else {
                        alert(data.Msg);
                    }
                }
            });
        }
    });

});
</script>
<script>

</script>

</html>